<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/app/mmsActivity/">活动列表</a></li>
		<li><a href="${ctx}/app/mmsActivity/form">活动添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="mmsActivity" action="${ctx}/app/mmsActivity/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>ID：</label>
				<form:input path="id" htmlEscape="false" maxlength="50" class="input-medium"/>
			<label>活动名称：</label>
				<form:input path="activityName" htmlEscape="false" maxlength="50" class="input-medium"/>
			<label>考种：</label>
				<form:select path="examType" class="input-medium">
					<option value="">&nbsp;&nbsp;&nbsp;&nbsp;-----请选择-----&nbsp;&nbsp;&nbsp;&nbsp;</option>
					<form:options items="${dictList }" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			<label>状态：</label>
			<form:select path="delFlag" htmlEscape="false" maxlength="50" class="required">
					<form:options items="${fns:getDictList('activity_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>ID</th><th>活动名称</th><th>考种</th><th>关联店铺名称</th><th>活动起止时间</th><th>状态</th><th>操作</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="mmsActivity">
			<tr>
				<%-- <td><a href="${ctx}/app/mmsActivity/form?id=${mmsActivity.id}">${mmsActivity.appproject.appName}</a></td> --%>
				<td>${mmsActivity.id}</td>
				<td><a href="${ctx}/app/mmsActivity/form?id=${mmsActivity.id}">${mmsActivity.activityName}</a></td>
				<%-- <td>${mmsActivity.examType}</td> --%>
				<td>
						<c:forEach items="${dictList}" var="dict">
							<c:choose>
								<c:when test="${dict.value==mmsActivity.examType}">
									${dict.label}
								</c:when>
							</c:choose>
						</c:forEach>
				</td>
				<td>${mmsActivity.shopName}</td>
				<td><fmt:formatDate value='${mmsActivity.beginDate}' pattern="yyyy-MM-dd"/>--<fmt:formatDate value='${mmsActivity.endDate}' pattern="yyyy-MM-dd"/></td>
				<td>${mmsActivity.delFlag eq '0'?'激活':'隐藏'}</td>
				<td>
					<a href="${ctx}/app/mmsActivity/delete?id=${mmsActivity.id}" onclick="return confirmx('确认要${mmsActivity.delFlag eq '0'?'隐藏':'激活'}该活动吗？', this.href)">${mmsActivity.delFlag eq '0'?'隐藏':'激活'}</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>